package org.glut.cloud.materialManage.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.glut.cloud.materialManage.entity.MaterialChange;
import org.glut.cloud.materialManage.entity.MaterialsManage;

import java.util.List;

/**
 * 材料管理表 服务类接口
 *
 * @author sanminzhi
 * @since 2024-07-19 11:26
 */
public interface IMaterialsManageService extends IService<MaterialsManage> {

    /**
     * 查看所有物料
     * @return 所有物料
     */
    List<MaterialsManage> getMaterialsManage();

    /**
     * 查询物料
     * @param materialName
     * @return 查询出的物料
     */
    List<MaterialsManage> findMaterials(String materialName);

    List<MaterialsManage> selectAll();

    Page<MaterialsManage> selectPage(int page, int size, String category,String query);

    List<MaterialsManage> getLowStockMaterials(int threshold);

    boolean deductMaterial(Integer materialId, int quantity);

    Page<MaterialChange> getMaterialChange(int page, int size);
}
